package leetcode.字符串;

public class Excel表列名称168 {
    public String convertToTitle(int columnNumber) {
        if(columnNumber <= 0)
            return "";
        StringBuilder str = new StringBuilder();
        while (columnNumber > 0){
            columnNumber--;
            str.append((char) (columnNumber%26 + 'A'));
            columnNumber /= 26;
        }
        return str.reverse().toString();
    }
}
